﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using log4net;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json;
using OAuth.EFCore.Interface;
using OAuth.EFCore.Model;
using OAuth.EFCore.Service;

namespace OAuth.EFCore.Api.Controller
{
    [Route("api/[controller]")]
    [ApiController]
    [Authorize]
    public class SSM01Controller : ControllerBase
    {
        #region "服务"
        private ILog log = LogManager.GetLogger(Startup.repository.Name, typeof(SSM01Controller));
        private readonly ISSM01 _ssm01;
        public SSM01Controller(SSM01Service ssm01)
        {
            _ssm01 = ssm01;
        }
        #endregion

        [HttpPost("AddUser")]
        public async Task<ActionResult> AddUser([FromForm]User user)
        {
            bool result = await _ssm01.AddUser(user);
            log.Info($"调用了方法：AddUser");
            return Ok(result);
        }




    }
}